<div ng-switch on="vm.type">
    <div ng-switch-when="post">
        <div class="modal-header">
            <h4 class="modal-title">岗位列表</h4>
        </div>
        <div class="modal-body">
            <ui-tabset active-id="vm.activeId">
                <ui-tab tab-id="org" select="vm.loadPost('org')">
                    <ui-tab-heading>管理岗位</ui-tab-heading>
                    <div ng-if="!vm.isOrgLoad" class="text-center">
                <span>
                    <i class="fa fa-spin fa-spinner"></i>
                    数据加载中...
                </span>
                    </div>
                    <table ng-if="vm.isOrgLoad" class="table" ng-delegate selector="input[type=checkbox]">
                        <thead>
                        <tr>
                            <th style="width: 5%">#</th>
                            <th style="width: 10%">岗位编码</th>
                            <th style="width: 20%">岗位名称</th>
                            <th style="width: 20%">岗位描述</th>
                            <th style="width: 10%">岗位状态</th>
                            <th style="width: 20%">创建时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="empty" ng-if="!vm.postList.length">
                            <td colspan="7" class="text-center empty">
                                <div class="hint">
                                    <span><i class="fa fa-exclamation-circle"></i>暂无更多数据</span>
                                </div>
                            </td>
                        </tr>
                        <tr ng-repeat="item in vm.postList track by $index">
                            <td><input type="checkbox" ng-checked="item.sys{{vm.classifyType}}Id" ng-click="vm.toggleCheck(item)"></td>
                            <td>{{item.sysPostCode}}</td>
                            <td>{{item.sysPostName}}</td>
                            <td>{{item.sysPostDesc}}</td>
                            <td><span class="label label-warning" ng-if="item.statusCd == 'S0X'">{{vm.status[item.statusCd]}}</span><span class="label label-success">{{vm.status[item.statusCd]}}</span></td>
                            <td>{{item.createDate | date:"yyyy-MM-dd"}}</td>
                        </tr>
                        </tbody>
                    </table>
                </ui-tab>
                <ui-tab tab-id="rzOrg" select="vm.loadPost('rzOrg')">
                    <ui-tab-heading>任职岗位</ui-tab-heading>
                    <div ng-if="!vm.isRzOrgLoad" class="text-center">
                <span>
                    <i class="fa fa-spin fa-spinner"></i>
                    数据加载中...
                </span>
                    </div>
                    <table ng-if="vm.isRzOrgLoad" class="table" ng-delegate selector="input[type=checkbox]">
                        <thead>
                        <tr>
                            <th style="width: 5%">#</th>
                            <th style="width: 10%">岗位编码</th>
                            <th style="width: 20%">岗位名称</th>
                            <th style="width: 20%">岗位描述</th>
                            <th style="width: 10%">岗位状态</th>
                            <th style="width: 20%">创建时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="empty" ng-if="!vm.postList.length">
                            <td colspan="7" class="text-center empty">
                                <div class="hint">
                                    <span><i class="fa fa-exclamation-circle"></i>暂无更多数据</span>
                                </div>
                            </td>
                        </tr>
                        <tr ng-repeat="item in vm.postList track by $index">
                            <td><input type="checkbox" ng-checked="item.sys{{vm.classifyType}}Id" ng-click="vm.toggleCheck(item)"></td>
                            <td>{{item.sysPostCode}}</td>
                            <td>{{item.sysPostName}}</td>
                            <td>{{item.sysPostDesc}}</td>
                            <td><span class="label label-warning" ng-if="item.statusCd == 'S0X'">{{vm.status[item.statusCd]}}</span><span class="label label-success">{{vm.status[item.statusCd]}}</span></td>
                            <td>{{item.createDate | date:"yyyy-MM-dd"}}</td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="pagination-group" ng-if="vm.postPager">
                        <ui-pagination items-per-page="vm.page.perPage" total-items="vm.page.post.totalItems" ng-model="vm.page.currentPage" max-size="3" jump-input="true" ng-change="vm.changePage(vm.page.currentPage)"></ui-pagination>
                    </div>
                </ui-tab>
            </ui-tabset>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary"  ng-click="vm.save()"><span ng-show="vm.submitting"><i class="fa fa-spinner fa-spin"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </div>
    <div ng-switch-when="role">
        <div class="modal-header">
            <h4 class="modal-title">角色列表</h4>
        </div>
        <div class="modal-body">
            <div class="table-wrap">
                <table class="table">
                    <thead>
                    <tr>
                        <th style="width: 5%">#</th>
                        <th style="width:20%">角色编码</th>
                        <th style="width:25%">角色名称</th>
                        <th style="width:25%">角色描述</th>
                        <th style="width:25%">归属系统</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="empty" ng-if="!vm.isRoleLoad">
                        <td colspan="5" class="text-center">
                            <span><i class="fa fa-spin fa-spinner"></i>数据加载中...</span>
                        </td>
                    </tr>
                    <tr class="empty" ng-if="vm.isRoleLoad && !vm.roleList.length">
                        <td colspan="5" class="text-center">
                            <span><i class="fa fa-exclamation-circle"></i>暂无数据</span>
                        </td>
                    </tr>
                    <tr ng-repeat="item in vm.roleList track by $index">
                        <td>
                            <input type="checkbox" ng-checked="item.sys{{vm.classifyType}}Id" ng-click="vm.toggleCheck(item)">
                        </td>
                        <td>{{item.sysRoleCode}}</td>
                        <td>{{item.sysRoleName}}</td>
                        <td>{{item.sysRoleDesc}}</td>
                        <td>{{item.platInfo.platName}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-primary"  ng-click="vm.save()"><span ng-show="vm.submitting"><i class="fa fa-spinner fa-spin"></i></span>保存</button>
            <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
        </div>
    </div>
</div>
